package com.javabi.htmlbuilder.css.declaration;

import com.javabi.htmlbuilder.css.CSSBuilder;
import com.javabi.htmlbuilder.css.CSSDeclaration;
import com.javabi.htmlbuilder.css.CSSPropertyName;

/**
 * A CSS Text Align.
 */
public enum TextAlign implements CSSDeclaration {

	/** text-align: left */
	LEFT("left"),
	/** text-align: right */
	RIGHT("right"),
	/** text-align: center */
	CENTER("center"),
	/** text-align: justify */
	JUSTIFY("justify"),
	/** text-align: inherit */
	INHERIT("inherit");

	/** The value. */
	private final String value;

	/**
	 * Creates a new declaration.
	 * @param value the value.
	 */
	private TextAlign(String value) {
		this.value = value;
	}

	/**
	 * Returns the value.
	 * @return the value.
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Returns the property.
	 * @return the property.
	 */
	public CSSPropertyName getPropertyName() {
		return CSSPropertyName.TEXT_DECORATION;
	}

	/**
	 * Append this to the given css builder.
	 * @param css the css builder.
	 * @return the css builder.
	 */
	public CSSBuilder appendTo(CSSBuilder css) {
		return css.property(getPropertyName(), getValue());
	}

}
